package com.colabo.j2ee.web.oaf.orgnization.impl;

import java.util.List;

import com.colabo.j2ee.web.core.exception.ServiceException;
import com.colabo.j2ee.web.core.service.impl.DefaultServiceImpl;
import com.colabo.j2ee.web.oaf.monitorperspective.ILogDataService;
import com.colabo.j2ee.web.oaf.orgnization.IRoleService;
import com.colabo.j2ee.web.oaf.orgnization.model.IPRoleVO;


public class RoleServiceImpl extends DefaultServiceImpl implements IRoleService {
	private ILogDataService logDataService = null; 
	
	public IPRoleVO getRoleByRoleId(String roleid) throws ServiceException {
		return (IPRoleVO) findByID_Hibernate_Get(IPRoleVO.class, roleid);
	}

	public List getAllRoles() throws ServiceException {
		return find_iBatis("org.getAllRoles", null);
	}

	public IPRoleVO getDefaultRole() throws ServiceException {
		List r = find_iBatis("org.getDefaultRoles", null);
		if (r.size() > 0) {
			return (IPRoleVO) r.get(0);
		}
		return null;
	}

	public ILogDataService getLogDataService() {
		return logDataService;
	}

	public void setLogDataService(ILogDataService logDataService) {
		this.logDataService = logDataService;
	}
}
